package com.hnevc.xiaoming;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import androidx.appcompat.app.AppCompatActivity;

import com.hnevc.xiaoming.activity.MyShoping;
import com.hnevc.xiaoming.activity.MyViewPager;
import com.hnevc.xiaoming.shijianactivity.EventHanding;
import com.hnevc.xiaoming.shijianactivity.FocusActivity;
import com.hnevc.xiaoming.shijianactivity.KeyListenerActivity;
import com.hnevc.xiaoming.shijianactivity.LongActivity;
import com.hnevc.xiaoming.shijianactivity.TouchActivity;

public class MainActivity extends AppCompatActivity implements View.OnClickListener {

    private Button soping;
    private Button ViewPage;
    private Button Ev_Hd;
    private Button Touch_layout;
    private Button long_an;
    private Button focs_an;
    private Button onKey_listener;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        initView();

    }

    private void initView() {
        soping = (Button) findViewById(R.id.soping);

        soping.setOnClickListener(this);
        ViewPage = (Button) findViewById(R.id.ViewPage);
        ViewPage.setOnClickListener(this);
        Ev_Hd = (Button) findViewById(R.id.Ev_Hd);
        Ev_Hd.setOnClickListener(this);
        Touch_layout = (Button) findViewById(R.id.Touch_layout);
        Touch_layout.setOnClickListener(this);
        long_an = (Button) findViewById(R.id.long_an);
        long_an.setOnClickListener(this);
        focs_an = (Button) findViewById(R.id.focs_an);
        focs_an.setOnClickListener(this);
        onKey_listener = (Button) findViewById(R.id.onKey_listener);
        onKey_listener.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.soping:
                startActivity(new Intent(MainActivity.this, MyShoping.class));
                break;
            case R.id.ViewPage:
                startActivity(new Intent(MainActivity.this, MyViewPager.class));
                break;
            case R.id.Ev_Hd:
                startActivity(new Intent(MainActivity.this, EventHanding.class));
                break;
            case R.id.Touch_layout:
                startActivity(new Intent(MainActivity.this, TouchActivity.class));
                break;
            case R.id.long_an:
                startActivity(new Intent(MainActivity.this, LongActivity.class));
                break;
            case R.id.focs_an:
                startActivity(new Intent(MainActivity.this, FocusActivity.class));
                break;
            case R.id.onKey_listener:
                startActivity(new Intent(MainActivity.this, KeyListenerActivity.class));
                break;
        }
    }
}